﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SherlockGUI.CFG;

namespace SherlockGUI.Dlg
{
    public partial class LogInDlg : Form
    {
        public LogInDlg()
        {
            InitializeComponent();
        }

        private void LogInDlg_Load(object sender, EventArgs e)
        {

        }

        private void button_OK_Click(object sender, EventArgs e)
        {
            if (textBox_PWD.Text.Length < 1 || textBox_UserCode.Text.Length < 1)
            {
                MessageBox.Show("用户名和密码不能为空");
                return;
            }

            if (GlobalCfg.CheckUserPWD(textBox_UserCode.Text, textBox_PWD.Text) == false)
            {
                MessageBox.Show("用户名或密码错误");
                return;
            }

            GlobalCfg.m_OperatorCfg.bLogIn = true;

            //MessageBox.Show("登陆成功");

            Close();
        }

        private void button_Close_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
